package net.homeftp.heimo.weddingwidget.core;

public class CorrectDate {
    private int year = 0;
    private int month = 0;
    private int day = 0 ;

    public void setYear(int year) {
        this.year = year;
    }

    public int getYear() {
        return year;
    }

    public void setMonth(int month) {
        this.month = month;
    }

    public int getMonth() {
        return month;
    }

    public void setDay(int day) {
        this.day = day;
    }

    public int getDay() {
        return day;
    }
    
    public Double getGetAgeInMonthBase(){
    	Double a = (this.year*12)+(this.month)+(this.day>0?(this.day/30.5):0);
    	return a;
    }

    public Double getGetAgeInYearBase(){
    	Double b = (this.year)+((this.month + (this.day>0?(this.day/30.5):0) )/12);
    	return b; 
    }

    public String toString(){
        return ((year>0)?(year+"y"):"") + ((month>0)?(month+"m"):"") + ((day==0)?"":(day+"d"));
    }
}